<?php

if(!isset($authorizedPage)){
	require('../error.php');
}
else{	
	
	//*** Change this to false when pushed on to the live websites
	$development = true;

	if($development){
	//*** Development Variables
		$developmentId 			= '283770201722620';
		$developmentChannelFile = 'http://localhost/food-is-good/%20food-is-good%20--username%20maxbow89@gmail.com/facebook/channel.html';
		$developmentSecret 		= 'c243eddda7837b7c24cc8a87d1bae195';
	}
	else{
	//*** Production Variables
		$developmentId 			= '185075714961419';
		$developmentChannelFile = 'WWW.friendlycooks.com/facebook/channel.html';
		$developmentSecret 		= 'cf3806bdcf051203bf263e3ddc5c4f65';
	}
	
	
	require_once 'facebook/src/facebook.php';
	
	$facebook = new Facebook(array(
		'appId'  => $developmentId,
		'secret' => $developmentSecret,
		'cookie' => true
	));
	
	$user = $facebook->getUser();
	
	if ($user) {
	  try {
		// Proceed knowing you have a logged in user who's authenticated.
		$user_profile = $facebook->api('/me');
	  } catch (FacebookApiException $e) {
		error_log($e);
		$user = null;
	  }
	}
	
	//**This fetches the information for a userId
	//$pageContent = file_get_contents('http://graph.facebook.com/800210260');
	//$parsedJson  = json_decode($pageContent);
	//echo $parsedJson->name;
	
}

?>